<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
         //得到一个两数之间的随机整数，包括两个数在内
         function getRandomIntInclusive(min, max) {
             min = Math.ceil(min);
             max = Math.floor(max);
             return Math.floor(Math.random() * (max - min + 1)) + min; //含最大值，含最小值
         }
         for(let i = 0;i<10;i++){
            console.log(getRandomIntInclusive(1,9));
         }
    </script>
</body>
</html>